package com.fan.txl.ui.adapter;

import android.view.View;
import com.base.txl.utils.ComponentUtils;
import com.fan.txl.R;
import com.fan.txl.data.feed.Feed;
import com.fan.txl.listener.OnClick;
import com.fan.txl.BR;
import com.fan.txl.databinding.ActivityFairItemBinding;
import com.fan.txl.ui.routers.ComponentRouters;

import java.util.List;

/**
 * Created by jiajiabao on 17-1-10.
 */

public class FeedBindAdapt extends BindAdapt<Feed> implements OnClick {

    @Override
    public int getLayoutId(int viewType) {
        return R.layout.activity_fair_item;
    }

    @Override
    public int getVariableId() {
        return BR.feed;
    }

    @Override
    public void onDataBind(BindingVHolder holder, int position) {
        ActivityFairItemBinding binding=(ActivityFairItemBinding) holder.getBinding();
        binding.setOnClick(this);
        binding.setFeed(mData.get(position));
    }


    public FeedBindAdapt(List<Feed> data) {
        super(data);
    }

    @Override
    public void click(View view) {
        Feed  feed= (Feed) view.getTag();
        ComponentUtils.start(view.getContext(), ComponentRouters.friend);
    }


}
